UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+fF/LHMfDpDv4fsq8d6ZS4s/6usXufYJkkwuULtp2z4=' 
WHERE 
  key_id = '992b4dae577bf2afd4d92aa8975c27f50d99161b59a90dd6fb935c7a31748002' 
  AND (
    token = '+fF/LHMfDpDv4fsq8d6ZS4s/6usXufYJkkwuULtp2z4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031