UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3QdiLxpNjOFA5NXDQnZX75LTi1hmRhqjY7sYAkHWKPg='
WHERE
key_id = '9372e1282509e6ec61a28b8645a98b8d7e423b561a659a2c935c545e72f401d8'
AND (
token = '3QdiLxpNjOFA5NXDQnZX75LTi1hmRhqjY7sYAkHWKPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)