UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EEv3ve+hzAosPyr2cfat6M+vxg5ZCqFdm+FDyLxBZ5Q='
WHERE
key_id = '564b38eab19c69e14f4e85ec7c0085f5e4609208b9b2f298e8123f238a96b6e4'
AND (
token = 'EEv3ve+hzAosPyr2cfat6M+vxg5ZCqFdm+FDyLxBZ5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)