UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xh2XgXyTfqJLSKlBKX3ndt7xZjnxd9W5PJNfwjHXeHk='
WHERE
key_id = '180bc6c9377e6039aec197e409bd44ff99bfccdebde1d35a5258bc774baad2eb'
AND (
token = 'Xh2XgXyTfqJLSKlBKX3ndt7xZjnxd9W5PJNfwjHXeHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)