UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sS8bw9sZMtFmMIaOH8pksllq3o9kSQXt3MbO/BtQxY0='
WHERE
key_id = '10daf2bf63d8344c1f71801baf3f86c82a3fb4ae67bfeb15b9f91ba0d211ac77'
AND (
token = 'sS8bw9sZMtFmMIaOH8pksllq3o9kSQXt3MbO/BtQxY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)