UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+EA4B15GrxyO8zH4rvDfrYhn3wV5SOpCyAhPOZQe1kc='
WHERE
key_id = 'cb466e9895016607860099b9d084e8c267feb848402ba5c9710baa76dbfd37d2'
AND (
token = '+EA4B15GrxyO8zH4rvDfrYhn3wV5SOpCyAhPOZQe1kc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)