UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LCMfM1IhVhYR3gczF9eoFCHtA8pVJ8Uv0/vI4UhNmM8=' 
WHERE 
  key_id = 'ebbf066bdc33d6cdd5f26a497821b216ab296df41e6b4bf1cf55fd4db99523c5' 
  AND (
    token = 'LCMfM1IhVhYR3gczF9eoFCHtA8pVJ8Uv0/vI4UhNmM8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025