UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/+QOJ8eWxfX/OdbXFxmNcAW1aYv0SfXx39E4hl/w27A='
WHERE
key_id = 'fbe7fb333c085e7cf3fcbce8096a96dcb157e6a228796ff823e1a0c21fc3e799'
AND (
token = '/+QOJ8eWxfX/OdbXFxmNcAW1aYv0SfXx39E4hl/w27A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)