UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gtwVnS1N/I5FPfOGEffTf5QMm1MHsvcgl8hHdsJ5918=' 
WHERE 
  key_id = '426e234d9be2d0dd3c2193b51d27e602b6935a1169133cf8d70edc755a0842ce' 
  AND (
    token = 'gtwVnS1N/I5FPfOGEffTf5QMm1MHsvcgl8hHdsJ5918=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014