UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dJAdUvPjUX2mUSGLDC5DTRuNN0mbZP0dO4a30caE/T0=' 
WHERE 
  key_id = '705c1f2abd6acb32a22c5d15ab18cc260b8d4606c4c546635dc9f978e0eb90ce' 
  AND (
    token = 'dJAdUvPjUX2mUSGLDC5DTRuNN0mbZP0dO4a30caE/T0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026