UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QGyhLQN+2tdaXDM6N0BjwsghD5/izSjHTrgR3XfFB1A='
WHERE
key_id = '7eba3fb8a9113664954bca307a530ee723b7130a132cf801852ca9682ac3187b'
AND (
token = 'QGyhLQN+2tdaXDM6N0BjwsghD5/izSjHTrgR3XfFB1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)