UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'szUzLdboT061J7IpUDJPbFtKJ/EWkEJADE30tQLMJbY='
WHERE
key_id = 'bede4b4b141bb5467756f1a5723b7a1e434da8f2e8fc50f64058d2945d3942c2'
AND (
token = 'szUzLdboT061J7IpUDJPbFtKJ/EWkEJADE30tQLMJbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)