UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eDzhujBDNXQ7oxgB9D6qQF33M2M2RAssZ/yBrqAYzEQ=' 
WHERE 
  key_id = '8a19dea8d066082dbb580fc652bbc4b831c2b7c720de5ab436d00a2010af9b09' 
  AND (
    token = 'eDzhujBDNXQ7oxgB9D6qQF33M2M2RAssZ/yBrqAYzEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021