UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yjeBAQrIrCnZHwJYK7N3QsrU9FGmwJWQrGMtgerqeYk='
WHERE
key_id = '90f10855c7a046a40c881eb2f6efe8f10ab5eb4f915062b2204bcdb9c3719a37'
AND (
token = 'yjeBAQrIrCnZHwJYK7N3QsrU9FGmwJWQrGMtgerqeYk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)