UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1r+jEEk5ZyEt5+HiCOWXadmApHJzRc5dJMNbDJOR8RE='
WHERE
key_id = '0ad4d4bd3d9148fafc3838b395c46580556ea14d383cdc4581ba34cc1027d51d'
AND (
token = '1r+jEEk5ZyEt5+HiCOWXadmApHJzRc5dJMNbDJOR8RE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)