UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jGgiPadvFFHmJxJ8T4KuTnIZETOqBJyg/tPtiXXYvM0='
WHERE
key_id = '406cae2be481f00a16d90ebf8beae9b04b22e3a943e92078ed2a0fd241dc9866'
AND (
token = 'jGgiPadvFFHmJxJ8T4KuTnIZETOqBJyg/tPtiXXYvM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)