UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L/zJ9gcWOuPPto6jMhJoPK0go4ACBRrUiIH/LloMoto='
WHERE
key_id = 'e78575da57d86ab3488c8db16c20a97498774af2677c9ae1f649a6a0b464640c'
AND (
token = 'L/zJ9gcWOuPPto6jMhJoPK0go4ACBRrUiIH/LloMoto='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)