UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4FHgYQ/S8pzpo/yQsymaVR9vElK64vnhDfaHxaj8B4M=' 
WHERE 
  key_id = '46cd5178853b7b9b986af6ee62b94924a93bdae5dcee04f3ccf08ec13909056b' 
  AND (
    token = '4FHgYQ/S8pzpo/yQsymaVR9vElK64vnhDfaHxaj8B4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022