UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4hyszmTFgVKPElSGW59JJKo9bxmDhTMvSezZiwDPMTw=' 
WHERE 
  key_id = '005d288171091b26be5424310cfcbe52c7c53e9fc5f6021347a7b55f759b5b3e' 
  AND (
    token = '4hyszmTFgVKPElSGW59JJKo9bxmDhTMvSezZiwDPMTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044