UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7lINcx2gVipc0e0LeA1qtfRie+0kNctYkixPJCOHKGM=' 
WHERE 
  key_id = 'eb2d8a25a8559a9a56bbfc5c0623582cc8d840caa0ed3ed8150534ea90cb52f5' 
  AND (
    token = '7lINcx2gVipc0e0LeA1qtfRie+0kNctYkixPJCOHKGM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034