UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uezFZNq0YCz0V/wqsE6W/70RVJLOjX3Rz7Ojkvd7fMc='
WHERE
key_id = 'a6815616b7dcefba6a6ec47d5047519105df82d6e2ecbae7fd9243ddacdfc362'
AND (
token = 'uezFZNq0YCz0V/wqsE6W/70RVJLOjX3Rz7Ojkvd7fMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)