UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZX8wjKUcCCL4r9dlSbPiC8MYoMlJwK8fYbV9mlvsIoE=' 
WHERE 
  key_id = '60905c369b869d3e52b8ec60dbc2c50cb7522a486c6336cfcb08b4ed67d78abd' 
  AND (
    token = 'ZX8wjKUcCCL4r9dlSbPiC8MYoMlJwK8fYbV9mlvsIoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054