UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ea0pTQu4Vmq1nDASNcZqBz/wJGpKDC/thKr3LHRyEuU=' 
WHERE 
  key_id = '33b41113ec807dbdb06788874bb13a3492d7b6ac4d05bdcae7c07f771181eed1' 
  AND (
    token = 'Ea0pTQu4Vmq1nDASNcZqBz/wJGpKDC/thKr3LHRyEuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015