UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nT0z7PyJqUpM/oLaljvCkBpn4liKU64Gn09M/ElnX18='
WHERE
key_id = '3b7f2c330def12e34694b1a0b10b071f355bce9d03c3f098046438ff7fbaae5b'
AND (
token = 'nT0z7PyJqUpM/oLaljvCkBpn4liKU64Gn09M/ElnX18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)