UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'snqtFIpEEONn2rsi/woiXiRd8TJtbCuceCuvQiTsSVo=' 
WHERE 
  key_id = '638b5bc87927ed461ba14aeafc6469fa6da20a545a65788e7b966018c1ede884' 
  AND (
    token = 'snqtFIpEEONn2rsi/woiXiRd8TJtbCuceCuvQiTsSVo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036