UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oXPk9c/EF1PHud+D+Q7f2npqCfgREKWEZvo+GmQpCOQ=' 
WHERE 
  key_id = 'd76f1c20d46a792cceced303eebbfa4417830ff62e44ce1b2738a5bb0a187b0b' 
  AND (
    token = 'oXPk9c/EF1PHud+D+Q7f2npqCfgREKWEZvo+GmQpCOQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045