UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wxNze7u9TBHddX4ezoX4QQIPzHFDNn61QiDZQjyDv4Y='
WHERE
key_id = '90851615a0d9c9eca4533e6009b9147e3876b5ea33b4155681ab6d693013b67a'
AND (
token = 'wxNze7u9TBHddX4ezoX4QQIPzHFDNn61QiDZQjyDv4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)