UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pk//It7T//WkhSMzwvXp2eOgHNz3EBK9/B07tCgMtTk='
WHERE
key_id = 'fad7d2d20ca4426aabdb421018e188e4a9c745f5871a2ab845b7580ee20463cb'
AND (
token = 'Pk//It7T//WkhSMzwvXp2eOgHNz3EBK9/B07tCgMtTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)