UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fylASxmPwDGRJQm+na9kNYpotQb+x3Wfqdva4XKV9SI=' 
WHERE 
  key_id = '281ee705493e17e23c3a1af415d9a1be5d6d0c9bd5bee29381f979f713e1adc9' 
  AND (
    token = 'fylASxmPwDGRJQm+na9kNYpotQb+x3Wfqdva4XKV9SI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020