UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MofCdFLfUAVbnkwy3dSHfBZt20hs5W3UldypSnLMWzw=' 
WHERE 
  key_id = 'cfdda0ee9592739cf33e39c527b81e393decb238473db38c266f597794764d6e' 
  AND (
    token = 'MofCdFLfUAVbnkwy3dSHfBZt20hs5W3UldypSnLMWzw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050