UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7m1iFGoAcXBx/dgI74cnPz0CaHfk64KmyWlRQr1F4qY='
WHERE
key_id = '88f1b0dcc2b8cf11ce5e738ffba48de56462f104f86b0104d83963986f3fb686'
AND (
token = '7m1iFGoAcXBx/dgI74cnPz0CaHfk64KmyWlRQr1F4qY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)