UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TKEfh8Aui3LmMAktlsut5uNG1WuytDleKxF4uLtUl4c=' 
WHERE 
  key_id = '4274a89f8992292eccb102bbc5db2157dae12c340b3610c1976f773a94ba83ca' 
  AND (
    token = 'TKEfh8Aui3LmMAktlsut5uNG1WuytDleKxF4uLtUl4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016