UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DmFLPuGKQEfGb07zk2w2CSjFhGkvqV9BmOpe+Neea54='
WHERE
key_id = 'ab149651fa222768efffd94c258f08009f6c59f17efc5aeea4fad04f38804c87'
AND (
token = 'DmFLPuGKQEfGb07zk2w2CSjFhGkvqV9BmOpe+Neea54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)