UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm+++qahWnXAl3jLtDcz5Rmx3EtHHbbmxfXWkxoe4syQ=' 
WHERE 
  key_id = '0904bdb353c9df42b0358dd2774fdc8a01b7b8e7c7d5924e7b0ad8fe27acc453' 
  AND (
    token = 'm+++qahWnXAl3jLtDcz5Rmx3EtHHbbmxfXWkxoe4syQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039