UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't5tqbAXY93BUkgBziMed1Qw4jylnk56ssxsCy5NNh9U='
WHERE
key_id = '92e226238f02b8645042ac1ed39561f7c1b3e90f6aaf9742a0b74bc0b644627b'
AND (
token = 't5tqbAXY93BUkgBziMed1Qw4jylnk56ssxsCy5NNh9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)