UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L1dBOapFPTtx3KpnLlrtHVcuGDB4pFBLC2vnExXDHgk=' 
WHERE 
  key_id = '0a2b3c36f34fe73ac6af0a2568b5c711621f6c4b62f09637fece9b3e9bf01fca' 
  AND (
    token = 'L1dBOapFPTtx3KpnLlrtHVcuGDB4pFBLC2vnExXDHgk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052