UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GGvUUxusXrSWCzRz7Uan6+P65wq9s4jyzTrXXcdEtpw='
WHERE
key_id = 'c7534b5a9369ef8f90bd52027a1351c63f15ee68edfcaaaf9dcc17daec36da42'
AND (
token = 'GGvUUxusXrSWCzRz7Uan6+P65wq9s4jyzTrXXcdEtpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)