UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vnIb2CrjFtpXQhPo7NgAwL+Ljm/yHiFWnMq4+K+cyeE='
WHERE
key_id = 'ec49cdac34605af00def4f84ce93ee0ed587d14d60639034ebb747ef9733dc98'
AND (
token = 'vnIb2CrjFtpXQhPo7NgAwL+Ljm/yHiFWnMq4+K+cyeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)