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

Query time 0.00032