UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KuQHAc0uo/Ieh8iYxxoNlY202qrI+3pSkgZIkSRQXqc=' 
WHERE 
  key_id = '5fa08604ce44c1e6d8139e62c41724109a2a832d99698936ed0d07cbccc7cc12' 
  AND (
    token = 'KuQHAc0uo/Ieh8iYxxoNlY202qrI+3pSkgZIkSRQXqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028