UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'USPfCrxFTlrM2wXhKnrMTV4ckLtoEp69L9hkqeyHbDU=' 
WHERE 
  key_id = '1c5091f84413bbb3da3b37674161c5cfe6a26fe2a81f13a3a2efec9f3ffdfc9d' 
  AND (
    token = 'USPfCrxFTlrM2wXhKnrMTV4ckLtoEp69L9hkqeyHbDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020