UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wrDHApEmIV99sPlQtRU6/tGbyTvr7nByz7TS31zl3kw='
WHERE
key_id = '5843b553e11cedbdf0b60c1aa3a6c5a552bc151560f56a56d3fd4492eb01df80'
AND (
token = 'wrDHApEmIV99sPlQtRU6/tGbyTvr7nByz7TS31zl3kw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)