UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nTbLIYer50yOtHRmaV/PnvuDyHi0pbgurdkn15aDksg=' 
WHERE 
  key_id = '053d85dd87f9d4d0c9dc9eb5dcfdc2bc3b7c9baff28d81f7a59e86fde69816e6' 
  AND (
    token = 'nTbLIYer50yOtHRmaV/PnvuDyHi0pbgurdkn15aDksg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030