UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ndWsq9WNz9Mmid2WFSTUwX4kE7pG+Qa/AZ+jyxPOJ0I='
WHERE
key_id = 'd935b2333c68300d78f56a753420437ba37f40a3a1049130a4b7b8e4916a7223'
AND (
token = 'ndWsq9WNz9Mmid2WFSTUwX4kE7pG+Qa/AZ+jyxPOJ0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)