UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nVZDNI/JymB2Yuo+z1LABVmi/4H99eoLWVmGfI0JhM4='
WHERE
key_id = '2f9334999f66ebf06dd045e44a0446c53ac65389f206e227dff65a74e1ec1e94'
AND (
token = 'nVZDNI/JymB2Yuo+z1LABVmi/4H99eoLWVmGfI0JhM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)