UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tmwynT7h3jgC5ojAR2Li/lloJFUDyjbW16d7yXjU8BI='
WHERE
key_id = '399b2e56ee095175e58bb9d0cb7fd23700d51fc4c61ee6b0f256fb152fbaafb3'
AND (
token = 'tmwynT7h3jgC5ojAR2Li/lloJFUDyjbW16d7yXjU8BI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)