UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wEeocfsqePu7ymrUUGR8T99KBhKS/akurjb0wE5BJXE=' 
WHERE 
  key_id = '86be1fdb07e69ceb59ecb57339c46abf3d42e74befb1687726e923c0edac3a53' 
  AND (
    token = 'wEeocfsqePu7ymrUUGR8T99KBhKS/akurjb0wE5BJXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024