UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VtbpX+DUaBLOX8R+F/T3YeElBctyHmf2NIByZ+eKWNw='
WHERE
key_id = 'eec8be610ef3d68a8f7aff4b47adaf9dcb8538019d6a5c053790b275dffec3a2'
AND (
token = 'VtbpX+DUaBLOX8R+F/T3YeElBctyHmf2NIByZ+eKWNw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)