UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'szssEBnxUmjUqVu0RqJ3zawrPAnOWnmkf1vLypl+7bw='
WHERE
key_id = '73b55195d56cdb8daa290f87f2cd341e0fc587bed520ad7934d6e310750a907c'
AND (
token = 'szssEBnxUmjUqVu0RqJ3zawrPAnOWnmkf1vLypl+7bw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)