UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b28sCycI0ooGnHJX1azrCDVy6wBpn50/HBFfr5DRkis='
WHERE
key_id = '9dc8518359453a00e15ad8ee45755ada3b6c2a83d25f29e6ba218490640690fe'
AND (
token = 'b28sCycI0ooGnHJX1azrCDVy6wBpn50/HBFfr5DRkis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)