UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TwjFQqv/FfeQiCWzhEC0bj2eGt+q/N/c9T1jhxcc7hM='
WHERE
key_id = 'da69c3dbff186012667db923debdbf3eaa8e3cf5f80ace83a9501b1612343754'
AND (
token = 'TwjFQqv/FfeQiCWzhEC0bj2eGt+q/N/c9T1jhxcc7hM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)