UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qsnvPVbAjvS0f2WrwVfETD4AEwlS3zgA1866bVEvXQk='
WHERE
key_id = '5d017f036a41cfeafbdf7ec2b60b822a6009585f43dd0ef451929e77ed8d9fb5'
AND (
token = 'qsnvPVbAjvS0f2WrwVfETD4AEwlS3zgA1866bVEvXQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)